// boomobj.txt
//
// A simple script that has nothing to do with anything.
// It just displays explosions every once and while.
// For example, a lava plain can have some, but not too many, of these.

// Reminds me of a script in The Za-Khazi Run.

// Cell 0 - Explosion graphic.
// Cell 1 - If 0, there is one explosion at a time. If 1, there is many of them at once.
// Cell 2 - Explosion sound. Leave at 0 for no sound.

beginterrainscript;
variables;
    int lat;
body;
beginstate INIT_STATE;
break;
beginstate START_STATE;
    lat = get_current_tick();
    if (lat < get_current_tick() - 8) {
        if (get_memory_cell(1) == 1) {
            put_boom_on_space(my_loc_x(), my_loc_y(), get_memory_cell(0), 1);
            put_boom_on_space(my_loc_x(), my_loc_y(), get_memory_cell(0), 1);
            put_boom_on_space(my_loc_x(), my_loc_y(), get_memory_cell(0), 1);
            put_boom_on_space(my_loc_x(), my_loc_y(), get_memory_cell(0), 1);
            }
        else put_boom_on_space(my_loc_x(), my_loc_y(), get_memory_cell(0), 0);
        if (get_memory_cell(2) == 0)
            run_animation();
        else run_animation_sound(get_memory_cell(2));
        }
break;